package day4.zuoye;

import java.util.Scanner;

public class Test14 {
    public static void main(String[] args) {
                System.out.println("请输入一个数");
                boolean flag = true;
                Scanner sc = new Scanner(System.in);// 获取控制台信息
                int num = sc.nextInt();
                for (int i = 2;i < num/2;i++) {
                    if (num % i != 0) {
                        flag = false;
                        break;
                    }
                }
                if (flag) {
                    System.out.println(num+"不是质数");

                } else {
                    System.out.println(num+"是质数");

                }
            }
}
